Because the memory occupied by the program running is too large, you can reduce the program size.During debugging, we found that the size occupied by the struct was different from the Expected One ......
Let's take a look at what we will talk about
At the end of the article, I made a picture and understood it at a Glance. I have talked a lot about this issue on the Internet, but I have not thoroughly explained it.
I. ConceptsAlignment is related to the location of data in the memory. If the
Memory Alignment
1. Concept
Alignment is related to the location of the data in memory. If the memory address of a variable is exactly the integer multiple of its length, he is called natural alignment. For example, under a 32-bit CPU, assuming an
Transferred from: https://www.cnblogs.com/ransn/p/5081198.htmlFirst, the conceptAlignment is related to the location of the data in memory. If the memory address of a variable is exactly the integer multiple of its length, he is called natural
Original source: http://blog.csdn.net/sujunzy666/article/details/18732153
The summary is very good, understand thoroughly.
The end of the article I made a picture, a look at it, this problem on the Internet to speak a lot, but did not put the
Reprint Address: http://blog.csdn.net/21aspnet/article/details/6729724First, the conceptAlignment is related to the location of the data in memory. If the memory address of a variable is exactly the integer multiple of its length, he is called
Original address: http://blog.csdn.net/21aspnet/article/details/6729724
The end of the article I made a picture, a look at it, this problem on the Internet to speak a lot, but did not put the problem through.
First, the conceptAlignment is related
First, the conceptAlignment is related to the location of the data in memory. If the memory address of a variable is exactly the integer multiple of its length, he is called natural alignment. For example, under a 32-bit CPU, assuming an integer
This is my reprint of the article ~ The original source I did not find.The whole concept of the article is explained very clearly, but there are some mistakes in the area ... (red flag)I'll give you a supplement to the other blog posts: http://soft.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.